﻿package frEngine.shader.filters.vertexFilters
{
    import __AS3__.vec.*;
    import baseEngine.core.*;
    import flash.geom.*;
    import frEngine.animateControler.particleControler.*;
    import frEngine.shader.*;
    import frEngine.shader.filters.*;
    import frEngine.shader.filters.vertexFilters.def.*;
    import frEngine.shader.registType.*;

    public class ParticleVertexFilter extends VertexFilter
    {
        public var particleFileData:ParticleFileData;
        private var time_perCircleTime_maxDuring_nearOne:Vector.<Number>;
        private var frictionSize:Vector.<Number>;
        private var lineForce:Vector.<Number>;
        private var shvDirection:Vector.<Number>;
        private var shvValue:Vector.<Number>;
        private var globlePosition:Vector.<Number>;
        private var endPoint:Vector.<Number>;

        public function ParticleVertexFilter(param1:ParticleFileData = null)
        {
            this.time_perCircleTime_maxDuring_nearOne = this.Vector.<Number>([0, 1, 100, 0.9998]);
            this.frictionSize = this.Vector.<Number>([0, 0, 0, 0]);
            this.lineForce = this.Vector.<Number>([0, 0, 0, 0]);
            this.shvDirection = this.Vector.<Number>([0, 0, 0, 0]);
            this.shvValue = this.Vector.<Number>([0, 0, 0, 0]);
            this.globlePosition = this.Vector.<Number>([0, 0, 0, 0]);
            this.endPoint = this.Vector.<Number>([0, 0, 0, 0]);
            this.particleFileData = param1;
            super(FilterType.particleAnimate);
            return;
        }// end function

        override public function setRegisterParams(param1:Program3dRegisterInstance) : void
        {
            var _loc_3:XYZObject = null;
            var _loc_4:Number = NaN;
            var _loc_5:FcParam = null;
            var _loc_6:XYZObject = null;
            var _loc_7:FcParam = null;
            var _loc_8:FsParam = null;
            var _loc_9:XYZObject = null;
            var _loc_2:* = this.particleFileData.particleParams;
            param1.getParamByName("{const}", true).value = this.Vector.<Number>([_loc_2.perParticleEmitterTime, _loc_2.total_number, _loc_2.rotateAxisYSpeed, _loc_2.lixinForceSize]);
            param1.getParamByName("{const2}", true).value = this.Vector.<Number>([_loc_2.growth_time, _loc_2.fade_time, _loc_2.inertiaValue, _loc_2.emitterTimeEffectPeriod - _loc_2.perParticleEmitterTime * 1.01]);
            param1.getParamByName("{time_perCircleTime_maxDuring_nearOne}", true).value = this.time_perCircleTime_maxDuring_nearOne;
            if (_loc_2.useFriction && _loc_2.useSpeed)
            {
                param1.getParamByName("{frictionSize}", true).value = this.frictionSize;
            }
            if (_loc_2.useLineForce)
            {
                param1.getParamByName("{lineForce}", true).value = this.lineForce;
            }
            if (_loc_2.useSimpleHarmonicVibration)
            {
                param1.getParamByName("{shvDirection}", true).value = this.shvDirection;
                param1.getParamByName("{shvValue}", true).value = this.shvValue;
            }
            if (!_loc_2.distanceBirth && !_loc_2.tailEnabled)
            {
                param1.getParamByName("{globlePosition}", true).value = this.globlePosition;
            }
            if (_loc_2.useEndPoint)
            {
                param1.getParamByName("{endPoint}", true).value = this.endPoint;
            }
            if (_loc_2.uvStep)
            {
                _loc_3 = _loc_2.uvStep;
                _loc_4 = isNaN(_loc_3.z) ? (1) : (_loc_3.z);
                _loc_5 = param1.getParamByName("{UVStepData}", false);
                if (_loc_5)
                {
                    _loc_5.value = this.Vector.<Number>([1 / _loc_3.x, 1 / _loc_3.y, _loc_3.w, 1 / _loc_4]);
                }
            }
            if (_loc_2.uvOffset)
            {
                _loc_6 = _loc_2.uvOffset;
                _loc_7 = param1.getParamByName("{UVOffsetData}", false);
                if (_loc_7)
                {
                    _loc_7.value = this.Vector.<Number>([_loc_6.x, _loc_6.y, _loc_6.z, _loc_6.w]);
                }
            }
            if (this.particleFileData.dateaTexture)
            {
                _loc_8 = param1.getParamByName("{dateaTexture}", false);
                var _loc_10:* = this.particleFileData.dateaTexture;
                _loc_8.value = this.particleFileData.dateaTexture;
            }
            if (_loc_2.uvFingerConst)
            {
                _loc_9 = _loc_2.uvFingerConst;
                param1.getParamByName("{UVFingerFrame}", false).value = this.Vector.<Number>([1 / _loc_9.x, 1 / _loc_9.y, -1, -1]);
            }
            return;
        }// end function

        override public function get programeId() : String
        {
            var _loc_1:* = this.particleFileData.particleParams;
            var _loc_2:String = "pc:";
            var _loc_4:* = _loc_2 + "0";
            _loc_2 = _loc_2 + "0";
            var _loc_4:* = _loc_2 + "1";
            _loc_2 = _loc_2 + "1";
            var _loc_4:* = _loc_2 + "2";
            _loc_2 = _loc_2 + "2";
            var _loc_4:* = _loc_2 + ("F-" + _loc_1.isFadeToGrowth + ",M-" + _loc_1.gf_smooth);
            _loc_2 = _loc_2 + ("F-" + _loc_1.isFadeToGrowth + ",M-" + _loc_1.gf_smooth);
            var _loc_4:* = _loc_2 + "3";
            _loc_2 = _loc_2 + "3";
            var _loc_4:* = _loc_2 + "4";
            _loc_2 = _loc_2 + "4";
            var _loc_4:* = _loc_2 + "5";
            _loc_2 = _loc_2 + "5";
            var _loc_4:* = _loc_2 + "6";
            _loc_2 = _loc_2 + "6";
            var _loc_4:* = _loc_2 + "7";
            _loc_2 = _loc_2 + "7";
            var _loc_4:* = _loc_2 + "8";
            _loc_2 = _loc_2 + "8";
            var _loc_4:* = _loc_2 + "9";
            _loc_2 = _loc_2 + "9";
            var _loc_4:* = _loc_2 + "#0";
            _loc_2 = _loc_2 + "#0";
            var _loc_4:* = _loc_2 + ("#R" + _loc_1.rotateAxisFlag);
            _loc_2 = _loc_2 + ("#R" + _loc_1.rotateAxisFlag);
            var _loc_4:* = _loc_2 + "#2";
            _loc_2 = _loc_2 + "#2";
            var _loc_4:* = _loc_2 + "#3";
            _loc_2 = _loc_2 + "#3";
            var _loc_3:* = _loc_1.offsetSmoothData ? ("1") : ("0");
            var _loc_4:* = _loc_2 + ("#5:" + _loc_1.uvRepeat + ",smooth:" + _loc_3);
            _loc_2 = _loc_2 + ("#5:" + _loc_1.uvRepeat + ",smooth:" + _loc_3);
            var _loc_4:* = _loc_2 + "#6";
            _loc_2 = _loc_2 + "#6";
            var _loc_4:* = _loc_2 + "#8";
            _loc_2 = _loc_2 + "#8";
            var _loc_4:* = _loc_2 + "#9";
            _loc_2 = _loc_2 + "#9";
            var _loc_4:* = _loc_2 + "#10";
            _loc_2 = _loc_2 + "#10";
            var _loc_4:* = _loc_2 + "#12";
            _loc_2 = _loc_2 + "#12";
            var _loc_4:* = _loc_2 + "#13";
            _loc_2 = _loc_2 + "#13";
            return _loc_2;
        }// end function

        override public function createVertexCode(param1:Program3dRegisterInstance, param2:int) : String
        {
            var _loc_3:* = this.particleFileData.particleParams;
            param1.OpType = ECalculateOpType.ViewProj;
            var _loc_4:Array = [];
            var _loc_5:int = 0;
            _loc_4.push(new ToBuilderInfo("va0", FilterName.POSITION, true, 4));
            _loc_4.push(new ToBuilderInfo("va1", FilterName.PARAM0, false, 4));
            _loc_4.push(new ToBuilderInfo("va3", FilterName.PARAM1, false, 3));
            if (_loc_3.distanceBirth || _loc_3.tailEnabled)
            {
                _loc_4.push(new ToBuilderInfo("vc0-60", "{vc0-60}", false, ParticleParams.maxConstRegistNum));
            }
            _loc_4.push(new ToBuilderInfo("vc1", "{time_perCircleTime_maxDuring_nearOne}", false, 1, this.time_perCircleTime_maxDuring_nearOne));
            _loc_4.push(new ToBuilderInfo("vc2", "{const}", false, 1, [_loc_3.perParticleEmitterTime, _loc_3.total_number, _loc_3.rotateAxisYSpeed, _loc_3.lixinForceSize]));
            _loc_4.push(new ToBuilderInfo("vc7", "{const2}", false, 1, [_loc_3.growth_time, _loc_3.fade_time, _loc_3.inertiaValue, _loc_3.emitterTimeEffectPeriod - _loc_3.perParticleEmitterTime * 1.01]));
            _loc_4.push(new ToBuilderInfo("vc4", "{globlePosition}", false, 1, this.globlePosition));
            _loc_4.push(new ToBuilderInfo("vm0", "{globleRotation}", false, 4, null));
            if (_loc_3.faceCamera)
            {
                _loc_4.push(new ToBuilderInfo("vm3", "{rotationMatrixRegister}", false, 3, new Matrix3D()));
            }
            var _loc_6:String = "";
            if (_loc_3.distanceBirth)
            {
                _loc_6 = _loc_6 + "mov           vt0      \t \t vc[va0.w]           \t\t\t\t\t\t\t\n";
                _loc_6 = _loc_6 + "sub           vt0.y      \t \t vc1.x\t\t\t\tvt0.w           \t\t\t\n";
                _loc_6 = _loc_6 + "mul           vt0.x      \t\t vc2.x\t\t\t\tva1.x           \t\t\t\n";
                _loc_6 = _loc_6 + "sub           vt0.x      \t\t vt0.y\t\t\t\tvt0.x           \t\t\t\n";
            }
            else
            {
                _loc_6 = _loc_6 + "mul           vt0.x      \t\t vc2.x\t\t\t\tva1.x           \t\t\t\n";
                _loc_6 = _loc_6 + "sub           vt0.x      \t\t vc1.x\t\t\t\tvt0.x           \t\t\t\n";
            }
            _loc_6 = _loc_6 + "div           vt0.y      \t\t vt0.x\t\t\t\tvc1.y           \t\t\t\n";
            _loc_6 = _loc_6 + "frc           vt0.z      \t\t vt0.y\t\t\t\t           \t\t\t\t\n";
            _loc_6 = _loc_6 + "sub           vt0.w      \t\t vt0.y\t\t\t\tvt0.z           \t\t\t\n";
            _loc_6 = _loc_6 + "mul           vt2.x      \t\t vt0.z\t\t\t\tvc1.y           \t\t\t\n";
            _loc_6 = _loc_6 + "div           vt2.z       \t\t vt2.x  \t\t  \tva1.y\t\t\t\t\t\t\n";
            if (_loc_3.useTimeGrowth)
            {
                _loc_6 = _loc_6 + "sge           vt2.y      \t\t vt0.x\t\t\t\t{vcConst1}.x           \t\n";
                _loc_6 = _loc_6 + "slt           vt4.x       \t vt2.z  \t\t  \tvc1.w\t\t\t\t\t\t\n";
                _loc_6 = _loc_6 + "min           vt2.y      \t\t vt4.x\t\t\t\tvt2.y           \t\t\t\n";
            }
            else
            {
                _loc_6 = _loc_6 + "slt           vt2.y       \t vt2.z  \t\t  \t{vcConst1}.z\t\t\t\t\n";
            }
            _loc_6 = _loc_6 + "div           vt3.x      \t\t vt0.w\t\t\t\tvc1.z           \t\t\t\n";
            _loc_6 = _loc_6 + "sge           vt3.x      \t\t vt3.x\t\t\t\tvc1.w           \t\t\t\n";
            _loc_6 = _loc_6 + "sub           vt3.x      \t\t {vcConst1}.z\t\tvt3.x           \t\t\t\n";
            _loc_6 = _loc_6 + "min           vt2.y      \t\t vt3.x\t\t\t\tvt2.y           \t\t\t\n";
            if (_loc_3.useGrowthAndFade)
            {
                if (_loc_3.isFadeToGrowth)
                {
                    _loc_6 = _loc_6 + this.getFadeAndGrowth();
                }
                else
                {
                    _loc_6 = _loc_6 + this.getGrowthAndFade();
                }
                _loc_6 = _loc_6 + "mul           vt1      \t \t va0\t\t\t\t\tvt1.w           \t\t\n";
            }
            else
            {
                _loc_6 = _loc_6 + "mov \t\t \t vt1 \t\t\t \t va0 \t\t\t\t\t\t\t\t\t\t\t\n";
            }
            _loc_4.push(new ToBuilderInfo("vc3", "{localScale}", false, 1, null));
            _loc_6 = _loc_6 + "mul           vt1      \t \t vt1\t\t\t\tvc3           \t\t\t\t\n";
            if (_loc_3.useAutoRotate || _loc_3.uvFingerConst)
            {
                _loc_4.push(new ToBuilderInfo("va6", FilterName.PARAM3, false, 4));
            }
            if (_loc_3.useAutoRotate)
            {
                _loc_6 = _loc_6 + "mul \t\tvt4.x\t\t\t\tvt2.z\t\t\t\tva6.x\t\t\t\n";
                _loc_6 = _loc_6 + "add \t\tvt4.x\t\t\t\tvt4.x\t\t\t\tva6.y\t\t\t\n";
                if (_loc_3.faceCamera)
                {
                    _loc_6 = _loc_6 + "cos\t\t\t\tvt3.z\t\t\t\tvt4.x\t\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "sin\t\t\t\tvt3.w\t\t\t\tvt4.x\t\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul\t\t\t\tvt4.xyzw\t\t\tvt3.zwwz\t\t\tvt1.xyxy\t\t\t\n";
                    _loc_6 = _loc_6 + "sub\t\t\t\tvt1.x\t\t\t\tvt4.x\t\t\t\tvt4.y\t\t\t\t\n";
                    _loc_6 = _loc_6 + "add\t\t\t\tvt1.y\t\t\t\tvt4.z\t\t\t\tvt4.w\t\t\t\t\n";
                }
                else
                {
                    _loc_4.push(new ToBuilderInfo("va5", FilterName.PARAM4, false, 3));
                    _loc_6 = _loc_6 + "mov \t\tvt6\t\t\t\t\tva5\t\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "sin \t\tvt6.w\t\t\t\tvt4.x\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul \t\tvt6.xyz\t\t\t\tvt6.w\t\t\t\tvt6.xyz\t\t\t\n";
                    _loc_6 = _loc_6 + "cos \t\tvt6.w\t\t\t\tvt4.x\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "dp4 \t\tvt3.x \t\t\t\tvt6\t\t\t\t\tvt6\t\t\t\t\n";
                    _loc_6 = _loc_6 + "rsq \t\tvt3.x \t\t\t\tvt3.x\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul \t\tvt6\t\t\t\t\tvt3.x\t\t\t\tvt6\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\tvt3.xyzw\t\t\tvt6.wzyx\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\tvt4.xyzw\t\t\tvt6.zwxy\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\tvt5.xyzw\t\t\tvt6.yxwz\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "neg \t\tvt3.y\t\t\t\tvt3.y\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "neg \t\tvt4.z\t\t\t\tvt4.z\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "neg \t\tvt5.x\t\t\t\tvt5.x\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\tvt1.w\t\t\t\t{vcConst1}.x\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "m44 \t\t{output}\t\t\tvt1\t\t\t\t\tvt3\t\t\t\t\n";
                    _loc_6 = _loc_6 + "m44 \t\tvt1 \t\t\t\t{output}\t\t\tvt3\t\t\t\t\n";
                }
            }
            else if (_loc_3.useRotateToVelocity)
            {
                _loc_6 = _loc_6 + "mov \t\t{output}.xyzw\t\t\t{vcConst1}.xxxx\t\t\t\t\n";
            }
            _loc_6 = _loc_6 + "mov           vt3      \t \t\t va3\t\t\n";
            _loc_6 = _loc_6 + "mul           vt3      \t \t\t vt3\t\t{localScale}\t\t\t\t\n";
            switch(_loc_3.rotateAxisFlag)
            {
                case "y":
                {
                    break;
                }
                case "z":
                {
                    break;
                }
                case "x":
                {
                    break;
                }
                default:
                {
                    break;
                }
            }
            if (_loc_3.useRotateToVelocity)
            {
            }
            if (_loc_3.useSpeed)
            {
                _loc_4.push(new ToBuilderInfo("va2", FilterName.PARAM2, false, 3));
                if (_loc_3.useFriction)
                {
                    _loc_4.push(new ToBuilderInfo("vc5", "{frictionSize}", false, 1, this.frictionSize));
                    _loc_6 = _loc_6 + "min           vt5.xyz      \t\tvt2.xxx\t\t\t\tvc5.xyz           \n";
                    if (_loc_3.useRotateToVelocity)
                    {
                        _loc_6 = _loc_6 + "sub           vt6.xyz      \tvc5.xyz    \t\tvt5.xyz\t  \t\t\t\t\n";
                        _loc_6 = _loc_6 + "div          vt6.xyz      \tvt6.xyz  \t\t\tvc5.xyz     \t\t\n";
                        _loc_6 = _loc_6 + "m33 \t\t \t vt4.xyz \t\t\tva2.xyz\t\t\t\tvm0 \t\t\t\n";
                        _loc_6 = _loc_6 + "mul\t\t \t vt4.xyz \t\t\tvt4.xyz \t\t\tvc3 \t\t\t\n";
                        _loc_6 = _loc_6 + "mul            vt6.xyz          vt6.xyz               vt4.xyz \t\t\n";
                        _loc_6 = _loc_6 + "add           {output}.xyz      {output}.xyz  \t vt6.xyz      \t\n";
                    }
                    _loc_6 = _loc_6 + "mul           vt6      \t\t\tvt5.xyz\t\t\t\tva2\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul           vt5.xyz      \t\tvt5.xyz\t\t\t\tvt5.xyz          \n";
                    _loc_6 = _loc_6 + "div           vt4      \t\t\tva2.xyz\t\t\t\tvc5.xyz          \n";
                    _loc_6 = _loc_6 + "mul           vt4      \t\t \tvt4\t\t\t\t\t{vcConst1}.y     \n";
                    _loc_6 = _loc_6 + "mul           vt4      \t\t \tvt5.xyz\t\t\t\tvt4           \t\n";
                    _loc_6 = _loc_6 + "sub           vt6      \t\t \tvt6\t\t\t\t\tvt4           \t\n";
                    _loc_6 = _loc_6 + "m33 \t\t \t vt6.xyz \t\t\tvt6.xyz\t\t\t\tvm0 \t\t\t\n";
                    _loc_6 = _loc_6 + "mul \t\t \t vt6.xyz \t\t\tvt6.xyz\t\t\t\tvc3 \t\t\t\n";
                    _loc_6 = _loc_6 + "add           vt3.xyz      \t \tvt3.xyz\t\t\t\tvt6.xyz         \n";
                }
                else
                {
                    _loc_6 = _loc_6 + "m33 \t\t \t vt4.xyz \t\t\tva2\t\t\t\tvm0 \t\t\t\n";
                    _loc_6 = _loc_6 + "mul           vt4.xyz            vt4.xyz         vc3             \n";
                    if (_loc_3.useRotateToVelocity)
                    {
                        _loc_6 = _loc_6 + "add           {output}.xyz      {output}.xyz  \t vt4.xyz      \t\n";
                    }
                    _loc_6 = _loc_6 + "mul           vt4.xyz      \t\t \tvt2.x\t\t\t\tvt4.xyz\t\t\t\t\n";
                    _loc_6 = _loc_6 + "add           vt3.xyz      \t \t\t vt3.xyz\t\t\t\tvt4.xyz           \t\n";
                }
            }
            else if (_loc_3.useEndPoint)
            {
                _loc_4.push(new ToBuilderInfo("vc0", "{endPoint}", false, 1, this.endPoint));
                _loc_6 = _loc_6 + "add           vt5 \t\t\tvt3       \tvc4           \t\t\t\n";
                _loc_6 = _loc_6 + "sub          vt5      \t \tvc0               vt5     \t\t\t\n";
                _loc_6 = _loc_6 + "mul           vt5      \t \t\t vt5\t\t\t   vt2.z           \t\t\n";
                _loc_6 = _loc_6 + "add           vt3      \t \t\t vt3\t\t\t\tvt5           \t\t\t\n";
            }
            if (_loc_3.hasForce)
            {
                _loc_6 = _loc_6 + "mul           vt4.w      \t\t \t\tvt2.x\t\t\t\tvt2.x           \t\n";
            }
            if (_loc_3.useLineForce)
            {
                _loc_4.push(new ToBuilderInfo("vc8", "{lineForce}", false, 1, this.lineForce));
                _loc_6 = _loc_6 + "mov      \t   vt5      \t\tvc8           \t\t\t\t\t\t\t\t\t\n";
                _loc_6 = _loc_6 + "m33 \t\t \t vt5.xyz \t\t\tvt5.xyz\t\t\t\tvm0 \t\t\t\t\t\t\n";
                _loc_6 = _loc_6 + "mul \t\t \t vt5.xyz \t\t\tvt5.xyz\t\t\t\tvc3 \t\t\t\t\t\t\n";
                _loc_6 = _loc_6 + "mul           vt5      \t\tvt5.xyz\t\t\t\tvt5.w\t\t\t\t\t\t\n";
                if (_loc_3.useRotateToVelocity)
                {
                    _loc_6 = _loc_6 + "mul      \t    vt4.xyz      \t\t \t\tvt5.xyz\t\t\t\t\t\tvt2.xxx    \n";
                    _loc_6 = _loc_6 + "add           {output}.xyz     \t\t\t{output}.xyz  \t \t\tvt4.xyz      \t\n";
                }
                _loc_6 = _loc_6 + "mul           vt5      \t\t \t\t\tvt5\t\t\t\t\t\tvt4.w          \t\n";
                _loc_6 = _loc_6 + "mul           vt5      \t\t \t\tvt5\t\t\t\t\t{vcConst1}.y           \t\n";
                _loc_6 = _loc_6 + "add           vt3      \t \t\t \tvt3\t\t\t\t\tvt5           \t\t\n";
            }
            if (_loc_3.useSimpleHarmonicVibration)
            {
                _loc_4.push(new ToBuilderInfo("vc11", "{shvDirection}", false, 1, this.shvDirection));
                _loc_4.push(new ToBuilderInfo("vc12", "{shvValue}", false, 1, this.shvValue));
                _loc_6 = _loc_6 + "mul           vt5.x      \t\t \tva1.z\t\t\t\t\t{shvValue}.w           \t\n";
                _loc_6 = _loc_6 + "add           vt5.x      \t\t \tvt5.x\t\t\t\t\t{shvValue}.z           \t\n";
                _loc_6 = _loc_6 + "add           vt5.x      \t\t \tvt2.x\t\t\t\t\tvt5.x\t\t\t\t        \n";
                _loc_6 = _loc_6 + "div      \t    vt5.x      \t\t \tvt5.x\t\t\t\t\t{shvValue}.x        \t\n";
                if (_loc_3.useRotateToVelocity)
                {
                    _loc_6 = _loc_6 + "cos\t     \t    vt4.x      \t\t \tvt5.x\t\t\t\t\t   \t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul      \t    vt4.x      \t\t \tvt4.x\t\t\t\t\t{shvValue}.y      \n";
                    _loc_6 = _loc_6 + "mul      \t    vt4.xyz      \t\t vt4.xxx\t\t\t\t{shvDirection}.xyz    \n";
                    _loc_6 = _loc_6 + "add           {output}.xyz     \t\t\t{output}.xyz  \t \t\tvt4.xyz      \t\n";
                }
                _loc_6 = _loc_6 + "sin\t     \t    vt5.x      \t\t \tvt5.x\t\t\t\t\t   \t\t\t\t\t\t\n";
                _loc_6 = _loc_6 + "mul      \t    vt5.x      \t\t \tvt5.x\t\t\t\t\t{shvValue}.y         \t\n";
                _loc_6 = _loc_6 + "mul      \t    vt5      \t\t \t\tvt5.x\t\t\t\t\t{shvDirection}       \t\n";
                _loc_6 = _loc_6 + "add           vt3      \t \t\t \tvt3\t\t\t\t\t\tvt5           \t\t\t\n";
            }
            if (_loc_3.useLiXinForce)
            {
                _loc_6 = _loc_6 + "mov\t\t\t\tvt5\t\t\t\t\t\tvt3\t\t\t\t\t\t\t\t\t\t\n";
                _loc_6 = _loc_6 + "mov\t\t\t\tvt5.y\t\t\t\t\t{vcConst1}.x\t\t\t\t\t\t\t\n";
                _loc_6 = _loc_6 + "dp3           \tvt4.y\t\t\t\t\tvt5.xyz\t\t\t\tvt5.xyz           \n";
                _loc_6 = _loc_6 + "sqt           \tvt4.y\t\t\t\t\tvt4.y\t\t\t\t\t       \t\t\t\n";
                _loc_6 = _loc_6 + "mul           \tvt4.z\t\t\t\t\tvt4.w\t\t\t\tvc2.w           \t\n";
                _loc_6 = _loc_6 + "mul           \tvt4.z      \t\t \tvt4.z\t\t\t\t{vcConst1}.y      \n";
                _loc_6 = _loc_6 + "sub           \tvt4.y\t\t\t\t\tvt4.y\t\t\t\tvt4.z           \t\n";
                _loc_6 = _loc_6 + "max           \tvt4.y\t\t\t\t\tvt4.y\t\t\t\t{vcConst1}.x      \n";
                _loc_6 = _loc_6 + "nrm           \tvt5.xyz\t\t\t\t\tvt5.xyz\t\t\t\t\t       \t\t\t\n";
                _loc_6 = _loc_6 + "mul           \tvt3.xz      \t\t \tvt5.xz\t\t\t\t\tvt4.y          \n";
                if (_loc_3.useRotateToVelocity)
                {
                    _loc_6 = _loc_6 + "mul           \tvt4.x\t\t\t\t\tvt2.x\t\t\t\tvc2.w           \t\n";
                    _loc_6 = _loc_6 + "neg           \tvt4.x\t\t\t\t\tvt4.x\t\t\t\t       \t\t\t\n";
                    _loc_6 = _loc_6 + "mul           \tvt4.xyz\t\t\t\t\tvt4.xxx\t\t\t\tvt5.xyz          \t\n";
                    _loc_6 = _loc_6 + "add           {output}.xyz     \t\t\t{output}.xyz  \t \t\tvt4.xyz      \t\n";
                }
            }
            if (_loc_3.useRotateToVelocity)
            {
                if (_loc_3.faceCamera)
                {
                    _loc_6 = _loc_6 + "mov         vt5.xyz\t\t\t\t{vcConst1}.xxz\t\t\t\t\n";
                    _loc_6 = _loc_6 + "m33 \t\t vt5.xyz \t\t\t vt5.xyz \t\t\tvm3\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "nrm \t\t vt5.xyz \t\t\t vt5.xyz \t\t\t\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "crs         vt6.xyz\t\t\t\tvt5.xyz\t    {output}.xyz  \t  \t\t\n";
                    _loc_6 = _loc_6 + "nrm \t\t \tvt6.xyz \t\t\t \tvt6.xyz \t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "crs         {output}.xyz\t\t\tvt6.xyz\t    vt5.xyz  \t  \t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul \t\t {output}.xyz\t\t\t{output}.xyz\t\t \tvt1.x\t\t\n";
                    _loc_6 = _loc_6 + "mul \t\t vt5.xyz\t\t\t \t\tvt5.xyz\t\t \t\t\t\tvt1.z\t\t\n";
                    _loc_6 = _loc_6 + "mul \t\t vt6.xyz\t\t\t\t\tvt6.xyz\t\t \t\t\t\tvt1.y\t\t\n";
                    _loc_6 = _loc_6 + "add\t\t vt1.xyz\t\t\t\t\t{output}.xyz\t\t \tvt5.xyz\t\t\n";
                    _loc_6 = _loc_6 + "add\t\t vt1.xyz\t\t\t\t\tvt1.xyz\t\t \t \t\t\tvt6.xyz\t\t\n";
                }
                else
                {
                    _loc_6 = _loc_6 + "nrm         {output}.xyz\t\t\t\t{output}.xyz\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov         vt4.xyz\t\t\t\t{vcConst1}.xzx\t\t\t\t\n";
                    _loc_6 = _loc_6 + "crs         vt5.xyz\t\t\t\tvt4.xyz\t    {output}.xyz  \t  \t\t\t\n";
                    _loc_6 = _loc_6 + "nrm        vt5.xyz           vt5.xyz                                         \n";
                    _loc_6 = _loc_6 + "dp3        vt6.x\t\t\t\t{output}.xyz  \t\tvt4.xyz\t\t\n";
                    _loc_6 = _loc_6 + "sub        vt6.z\t\t\t\t{vcConst1}.z  \t\tvt6.x\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul        vt6.z\t\t\t\tvt6.z  \t\t\t\t\t{vcConst1}.w\t\t\t\n";
                    _loc_6 = _loc_6 + "sqt         vt6.z\t\t\t\tvt6.z \t\t\t\t\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "add        vt6.w\t\t\t\t{vcConst1}.z  \t\tvt6.x\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul        vt6.w\t\t\t\tvt6.w  \t\t\t\t\t{vcConst1}.w\t\t\t\n";
                    _loc_6 = _loc_6 + "sqt         vt6.w\t\t\t\tvt6.w \t\t\t\t\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul        vt6.xyz\t\t\t\t vt5.xyz\t \t\t\t\tvt6.z\t\t\t\t\n";
                    _loc_6 = _loc_6 + "dp4 \t\tvt5.x \t\t\t\tvt6\t\t\t\t\tvt6\t\t\t\t\n";
                    _loc_6 = _loc_6 + "rsq \t\tvt5.x \t\t\t\tvt5.x\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul \t\tvt6\t\t\t\t\tvt5.x\t\t\t\tvt6\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\t{output}\t\t\t\t\tvt3\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\tvt3.xyzw\t\t\tvt6.wzyx\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\tvt4.xyzw\t\t\tvt6.zwxy\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\tvt5.xyzw\t\t\tvt6.yxwz\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "neg \t\tvt3.y\t\t\t\tvt3.y\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "neg \t\tvt4.z\t\t\t\tvt4.z\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "neg \t\tvt5.x\t\t\t\tvt5.x\t\t\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\tvt1.w\t\t\t\t{vcConst1}.x\t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "m44 \t\tvt1\t\t\tvt1\t\t\t\t\tvt3\t\t\t\t\n";
                    _loc_6 = _loc_6 + "m44 \t\tvt1 \t\t\tvt1\t\t\t\t\tvt3\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mov \t\tvt3        {output}\t\t\t\t\t\n";
                }
            }
            else if (_loc_3.faceCamera)
            {
                _loc_6 = _loc_6 + "m33 \t\t vt1.xyz \t\t\t vt1.xyz \t\t\tvm3\t\t\t\t\t\t\t\n";
            }
            else
            {
                _loc_6 = _loc_6 + "m33 \t\t \t vt1.xyz \t\t\t \tvt1.xyz\t\t\t\t\tvm0 \t\t\t\t\n";
            }
            if (_loc_3.distanceBirth || _loc_3.tailEnabled)
            {
                if (_loc_3.inertiaValue)
                {
                    _loc_6 = _loc_6 + "sub           vt3.w      \t \t\t va0.w\t\t\t\t{vcConst1}.z         \n";
                    if (_loc_3.distanceBirth)
                    {
                        _loc_6 = _loc_6 + "max           vt3.w      \t \t\t vt3.w\t\t\t\t{vcConst1}.x         \n";
                    }
                    else
                    {
                        _loc_6 = _loc_6 + "slt           vt2.w      \t \t\t vt3.w\t\t\t\t{vcConst1}.x         \t\n";
                        _loc_6 = _loc_6 + "mul           vt2.w      \t \t\t vt2.w\t\t\t\tvc2.y         \t\t\t\n";
                        _loc_6 = _loc_6 + "add           vt3.w      \t \t\t vt2.w\t\t\t\tvt3.w         \t\t\t\n";
                        _loc_6 = _loc_6 + "sge           vt2.w      \t \t\t vc7.w\t\t\t\tvt2.x         \t\t\t\n";
                        _loc_6 = _loc_6 + "min           vt2.y      \t \t\t vt2.y\t\t\t\tvt2.w         \t\t\t\n";
                    }
                    _loc_6 = _loc_6 + "mov           vt4      \t \t\t vc[va0.w]           \t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "sub           vt5      \t \t\t vt4           \tvc[vt3.w]\t\t\t\t\n";
                    _loc_6 = _loc_6 + "mul           vt5      \t \t\t vt5\t\t\t\tvc7.z           \t\t\n";
                    _loc_6 = _loc_6 + "mul           vt5      \t\t \t vt5\t\t\t\tvt2.x\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "add           vt3      \t \t\t vt3\t\t\t\tvt4           \t\t\t\n";
                    _loc_6 = _loc_6 + "add           vt3      \t \t\t vt3\t\t\t\tvt5           \t\t\t\n";
                }
                else
                {
                    _loc_6 = _loc_6 + "mov           vt4      \t \t\t vc[va0.w]           \t\t\t\t\t\t\n";
                    _loc_6 = _loc_6 + "add           vt3      \t \t\t vt3\t\t\t\tvt4           \t\t\t\n";
                }
                if (_loc_3.tailEnabled)
                {
                    _loc_6 = _loc_6 + "min           vt2.y      \t \t\t vt2.y\t\t\t\tvt4.w         \t\t\n";
                }
            }
            else
            {
                _loc_6 = _loc_6 + "add           vt3 \t\t\tvt3       \tvc4           \t\t\t\n";
            }
            _loc_6 = _loc_6 + "add           vt1      \t \t\t vt1\t\t\t\t\tvt3           \t\t\n";
            _loc_6 = _loc_6 + "mul           {output}      \t vt2.y\t\t\t\t vt1.xyz          \n";
            _loc_6 = _loc_6 + "mov           {output}.w      {vcConst1}.z           \t\t\t\t\n";
            _loc_4.push(new ToBuilderInfo("vf3", "{V_ParticleLife}", false, 1));
            _loc_6 = _loc_6 + "mov           vf3.xy      \t\tvt2.xy  \t\t \t \t\t\t\n";
            _loc_6 = _loc_6 + "mov           vf3.zw      \t\tva1.yzyz  \t\t \t \t\t\t\n";
            _loc_4.push(new ToBuilderInfo("vf2", "{v_param0}", false, 1));
            _loc_6 = _loc_6 + "mov           vf2      \t\t\tva1  \t\t \t \t\t\t\n";
            if (_loc_3.uvFingerConst)
            {
                _loc_4.push(new ToBuilderInfo("vf4", "{v_param1}", false, 1));
                _loc_6 = _loc_6 + "mov           vf4      \t\t\tva6  \t\t \t \t\t\n";
            }
            _loc_6 = param1.toBuild(_loc_6, _loc_4);
            return _loc_6;
        }// end function

        private function getSmoothOfGF() : String
        {
            var _loc_1:String = "";
            _loc_1 = _loc_1 + "slt vt3.x, \tvt1.w, \t{vcConst1}.y\n";
            _loc_1 = _loc_1 + "sge vt3.y, \tvt1.w, \t{vcConst1}.y\n";
            _loc_1 = _loc_1 + "pow vt3.z, \tvt1.w, \t{vcConst1}.w\n";
            _loc_1 = _loc_1 + "mul vt3.z, \tvt3.z, \t{vcConst1}.w\n";
            _loc_1 = _loc_1 + "mul vt3.w, \tvt1.w, \t{vcConst1}.w\n";
            _loc_1 = _loc_1 + "mul vt3.w, \tvt3.w, \t{vcConst1}.w\n";
            _loc_1 = _loc_1 + "sub vt3.w, \tvt3.w, \tvt3.z\n";
            _loc_1 = _loc_1 + "sub vt3.w, \tvt3.w, \t{vcConst1}.z\n";
            _loc_1 = _loc_1 + "mul vt3.xy, \tvt3.xy, \tvt3.zw\n";
            _loc_1 = _loc_1 + "add vt1.w, \tvt3.x, \tvt3.y\n";
            return _loc_1;
        }// end function

        private function getGrowthAndFade() : String
        {
            var _loc_1:String = "";
            _loc_1 = _loc_1 + "sub           vt3.w      \t \t va1.y\t\t\t\t\tvc7.y           \t\t\n";
            _loc_1 = _loc_1 + "slt           vt4.x      \t\t vt2.x\t\t\t\t\tvc7.x           \t\t\n";
            _loc_1 = _loc_1 + "sge           vt4.z      \t\t vt2.x\t\t\t\t\tvt3.w           \t\t\n";
            _loc_1 = _loc_1 + "max           vt4.y      \t\t vt4.x\t\t\t\t\tvt4.z           \t\t\n";
            _loc_1 = _loc_1 + "sub           vt4.y      \t \t {vcConst1}.z\t\t\tvt4.y           \t\t\n";
            _loc_1 = _loc_1 + "sub           vt4.w      \t \t va1.y\t\t\t\t\tvt2.x           \t\t\n";
            _loc_1 = _loc_1 + "div           vt3.x      \t \t vt2.x\t\t\t\t\tvc7.x           \t\t\n";
            _loc_1 = _loc_1 + "div           vt3.z      \t \t vt4.w\t\t\t\t\tvc7.y           \t\t\n";
            _loc_1 = _loc_1 + "mov           vt3.y      \t \t {vcConst1}.z\t\t\t\t\t           \t\n";
            _loc_1 = _loc_1 + "dp3           vt1.w      \t \t vt3.xyz\t\t\t\tvt4.xyz           \t\n";
            if (this.particleFileData.particleParams.gf_smooth)
            {
                _loc_1 = _loc_1 + this.getSmoothOfGF();
            }
            return _loc_1;
        }// end function

        private function getFadeAndGrowth() : String
        {
            var _loc_1:String = "";
            _loc_1 = _loc_1 + "sub           vt3.w      \t \t va1.y\t\t\t\t\tvc7.x           \t\t\n";
            _loc_1 = _loc_1 + "slt           vt4.x      \t\t vt2.x\t\t\t\t\tvc7.y           \t\t\n";
            _loc_1 = _loc_1 + "sge           vt4.z      \t\t vt2.x\t\t\t\t\tvt3.w           \t\t\n";
            _loc_1 = _loc_1 + "sub           vt4.y      \t \t vt2.x\t\t\t\t\tvt3.w           \t\t\n";
            _loc_1 = _loc_1 + "div           vt3.x      \t \t vt2.x\t\t\t\t\tvc7.y           \t\t\n";
            _loc_1 = _loc_1 + "sub           vt3.x      \t \t {vcConst1}.z\t\t\tvt3.x           \t\t\n";
            _loc_1 = _loc_1 + "div           vt3.z      \t \t vt4.y\t\t\t\t\tvc7.x           \t\t\n";
            _loc_1 = _loc_1 + "mov           vt3.y      \t \t {vcConst1}.x\t\t\t\t\t           \t\n";
            _loc_1 = _loc_1 + "dp3           vt1.w      \t \t vt3.xyz\t\t\t\tvt4.xyz           \t\n";
            var _loc_2:* = this.particleFileData.particleParams;
            if (_loc_2.gf_smooth)
            {
                _loc_1 = _loc_1 + this.getSmoothOfGF();
            }
            return _loc_1;
        }// end function

        override public function preCreateFragmentUvCoord(param1:Program3dRegisterInstance) : String
        {
            var _loc_6:Number = NaN;
            var _loc_7:Texture3D = null;
            var _loc_8:XYZObject = null;
            var _loc_9:XYZObject = null;
            var _loc_10:Number = NaN;
            var _loc_11:XYZObject = null;
            var _loc_2:* = this.particleFileData.particleParams;
            var _loc_3:String = "";
            var _loc_4:* = param1.getParamByName(FilterName.F_UVPostion, false);
            if (!_loc_4)
            {
                return _loc_3;
            }
            var _loc_5:Array = [];
            _loc_3 = _loc_3 + "sub           ft0.y\t\t\t\t{V_ParticleLife}.y \t{fcConst1}.x  \n";
            _loc_3 = _loc_3 + "kil           ft0.y\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n";
            if (_loc_2.uvOffset || _loc_2.uvStep)
            {
                _loc_6 = 1 / ParticleParams.bitmapHeight;
                _loc_5.push(new ToBuilderInfo("fc2", "{fconst1}", false, 1, [_loc_6 * 4.5, _loc_6 * 5.5, 0.001, -1]));
            }
            if (_loc_2.offsetSmoothData)
            {
                _loc_7 = this.particleFileData.dateaTexture;
                _loc_5.push(new ToBuilderInfo("fs0", "{dateaTexture}", false, 1, _loc_7));
            }
            if (_loc_2.uvOffset)
            {
                if (_loc_2.uvOffset)
                {
                    _loc_8 = _loc_2.uvOffset;
                    _loc_5.push(new ToBuilderInfo("fc0", "{UVOffsetData}", false, 1, [_loc_8.x, _loc_8.y, _loc_8.z, _loc_8.w]));
                    if (_loc_2.offsetSmoothData)
                    {
                        _loc_3 = _loc_3 + "div           ft0.x        \t\t{V_ParticleLife}.x  \t\t{V_ParticleLife}.z  \t\n";
                        _loc_3 = _loc_3 + "mov           ft0.y        \t\tfc2.x  \t\t  \t\t\t\t\t\t\t\t\t\t\n";
                        _loc_3 = _loc_3 + ("tex           ft1           \t\tft0.xy    \t\t\t\t" + getSmapleString("fs0", _loc_7.format, false, _loc_7.mipMode, "nearest") + "\t\n");
                        _loc_3 = _loc_3 + "add           {F_UVPostion}.xy        {F_UVPostion}.xy   fc0.xy   \t\t\t\t\n";
                        _loc_3 = _loc_3 + "mul           ft0.xy        \t\t\t\tfc0.zw         \tft1.zz\t\t\t\t\t\n";
                        _loc_3 = _loc_3 + "add           {F_UVPostion}.xy        {F_UVPostion}.xy   ft0.xy   \t\t\t\t\n";
                    }
                    else
                    {
                        _loc_3 = _loc_3 + "add           {F_UVPostion}.xy        {F_UVPostion}.xy   fc0.xy   \t\t\t\t\n";
                        _loc_3 = _loc_3 + "mul           ft0.xy        \t\t\t\tfc0.zw         \t{V_ParticleLife}.x\t\n";
                        _loc_3 = _loc_3 + "div           ft0.xy        \t\t\t\tft0.xy         \t{V_ParticleLife}.z\t\n";
                        _loc_3 = _loc_3 + "add           {F_UVPostion}.xy        {F_UVPostion}.xy   ft0.xy   \t\t\t\t\n";
                    }
                }
                if (!_loc_2.uvRepeat)
                {
                    _loc_3 = _loc_3 + "sge\t\t\tft0.xy\t   \t\t\t{F_UVPostion}.xy\t\t\t{fcConst1}.x\t\t\t\n";
                    _loc_3 = _loc_3 + "sge\t\t\tft1.xy\t   \t\t\t{fcConst1}.z\t\t\t\t{F_UVPostion}.xy\t\t\n";
                    _loc_3 = _loc_3 + "mul\t\t\tft0.xy\t   \t\t\tft0.xy\t\t\t\t\t\tft1.xy\t\t\t\t\t\n";
                    _loc_3 = _loc_3 + "min\t\t\tft0.x\t   \t\t\tft0.x\t\t\t\t\t\tft0.y\t\t\t\t\t\n";
                    _loc_3 = _loc_3 + "sub\t\t\tft0.x\t   \t\t\tft0.x\t\t\t\t\t\t{fcConst1}.z\t\t\t\n";
                    _loc_3 = _loc_3 + "kil\t\t\tft0.x\t   \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n";
                }
            }
            if (_loc_2.uvStep)
            {
                _loc_9 = _loc_2.uvStep;
                _loc_10 = isNaN(_loc_9.z) ? (1) : (_loc_9.z);
                _loc_5.push(new ToBuilderInfo("fc1", "{UVStepData}", false, 1, [1 / _loc_9.x, 1 / _loc_9.y, _loc_9.w, 1 / _loc_10]));
                _loc_3 = _loc_3 + "mul           ft0.y        \t\t{V_ParticleLife}.x  \tfc1.w\t\t\t\n";
                _loc_3 = _loc_3 + "mul           ft0.w        \t\t{V_ParticleLife}.w  \tfc1.z\t\t\t\n";
                _loc_3 = _loc_3 + "frc           ft0.x        \t\tft0.w  \t\t\t\t\t\t\t\t\t\n";
                _loc_3 = _loc_3 + "sub           ft0.w        \t\tft0.w  \t\t\t\t\tft0.x\t\t\t\n";
                _loc_3 = _loc_3 + "add           ft0.y        \t\tft0.w  \t\t\t\t\tft0.y\t\t\t\n";
                _loc_3 = _loc_3 + "add           ft0.w        \t\tft0.y  \t\t  \t\t\tfc2.z\t\t\t\n";
                _loc_3 = _loc_3 + "frc           ft0.x        \t\tft0.w\t\t\t\t\t\t\t\t\t\n";
                _loc_3 = _loc_3 + "sub           ft0.z        \t\tft0.w  \t\t  \t\t\tft0.x\t\t\t\n";
                _loc_3 = _loc_3 + "mul           ft0.w        \t\tft0.z  \t\t  \t\t\tfc1.x\t\t\t\n";
                _loc_3 = _loc_3 + "add           ft0.w        \t\tft0.w  \t\t  \t\t\tfc2.z\t\t\t\n";
                _loc_3 = _loc_3 + "frc           ft0.x        \t\tft0.w\t\t\t\t\t\t\t\t\t\n";
                _loc_3 = _loc_3 + "sub           ft0.z        \t\tft0.w  \t\t  \t\t\tft0.x\t\t\t\n";
                _loc_3 = _loc_3 + "mul           ft0.y        \t\tft0.z  \t\t  \t\t\tfc1.y\t\t\t\n";
                _loc_3 = _loc_3 + "mul           {F_UVPostion}.xy        {F_UVPostion}.xy      fc1.xy  \n";
                _loc_3 = _loc_3 + "add           {F_UVPostion}.xy        {F_UVPostion}.xy      ft0.xy  \n";
            }
            if (_loc_2.uvFingerConst)
            {
                _loc_11 = _loc_2.uvFingerConst;
                _loc_5.push(new ToBuilderInfo("fc3", "{UVFingerFrame}", false, 1, [1 / _loc_11.x, 1 / _loc_11.y, -1, -1]));
                _loc_3 = _loc_3 + "mul           {F_UVPostion}.xy        {F_UVPostion}.xy      fc3.xy  \t\t\t\n";
                _loc_3 = _loc_3 + "mul           ft0.xy        \t\t\t\tfc3.xy     \t\t\t{v_param1}.zw  \t\n";
                _loc_3 = _loc_3 + "add           {F_UVPostion}.xy        {F_UVPostion}.xy      ft0.xy  \t\t\t\n";
            }
            _loc_3 = param1.toBuild(_loc_3, _loc_5);
            return _loc_3;
        }// end function

        override public function createFragmentColor(param1:Program3dRegisterInstance, param2:Boolean) : String
        {
            var _loc_6:Texture3D = null;
            var _loc_7:Number = NaN;
            var _loc_3:String = "";
            var _loc_4:Array = [];
            var _loc_5:* = this.particleFileData.particleParams;
            _loc_3 = _loc_3 + "mul           {output}      {output}  \t\t {v_param0}.w\t\t\t\t\t\t\n";
            if (_loc_5.useColor || _loc_5.useAlpha)
            {
                _loc_6 = this.particleFileData.dateaTexture;
                _loc_7 = 1 / ParticleParams.bitmapHeight;
                _loc_4.push(new ToBuilderInfo("fs0", "{dateaTexture}", false, 1, _loc_6));
                _loc_4.push(new ToBuilderInfo("fc1", "{fconst0}", false, 1, [_loc_7 * 0, _loc_7 * 1, _loc_7 * 2, _loc_7 * 3]));
                _loc_3 = _loc_3 + "div           ft0.x        \t\t{V_ParticleLife}.x  \t\t {V_ParticleLife}.z \t\t\t\n";
                if (_loc_5.useColor)
                {
                    if (_loc_5.useDoubleColor)
                    {
                        _loc_3 = _loc_3 + "mov           ft0.y        \t\tfc1.x  \t\t  \t\t\t\t\t\t\t\t\t\t\n";
                        _loc_3 = _loc_3 + ("tex           ft1           \t\tft0.xy    \t\t\t\t" + getSmapleString("fs0", _loc_6.format, false, _loc_6.mipMode, "nearest") + "\t\n");
                        _loc_3 = _loc_3 + "mov           ft0.y        \t\tfc1.y  \t\t  \t\t\t\t\t\t\t\t\t\t\n";
                        _loc_3 = _loc_3 + ("tex           ft2           \t\tft0.xy    \t\t\t\t" + getSmapleString("fs0", _loc_6.format, false, _loc_6.mipMode, "nearest") + "\t\n");
                        _loc_3 = _loc_3 + "sge           ft0.z           \t{V_ParticleLife}.w    \t\t\t{fcConst1}.w\t\n";
                        _loc_3 = _loc_3 + "slt             ft0.w           \t{V_ParticleLife}.w    \t\t\t{fcConst1}.w\t\n";
                        _loc_3 = _loc_3 + "mul             ft1           \t\t   ft1    \t\t\t ft0.z      \t\n";
                        _loc_3 = _loc_3 + "mul             ft2           \t\t   ft2    \t\t\t ft0.w      \t\n";
                        _loc_3 = _loc_3 + "add             ft1           \t   ft1   \t\t\t ft2      \t\n";
                        _loc_3 = _loc_3 + "mul           {output}.xyz      ft1  \t\t  \t\t\t{output}.xyz\t\t\t\t\t\t\n";
                    }
                    else
                    {
                        _loc_3 = _loc_3 + "mov           ft0.y        \t\tfc1.x  \t\t  \t\t\t\t\t\t\t\t\t\t\t\t\n";
                        _loc_3 = _loc_3 + ("tex           ft1           \t\tft0.xy    \t\t\t\t" + getSmapleString("fs0", _loc_6.format, false, _loc_6.mipMode, "nearest") + "\t\n");
                        _loc_3 = _loc_3 + "mul           {output}.xyz      ft1  \t\t  \t\t\t{output}.xyz\t\t\t\t\t\t\n";
                    }
                }
                if (_loc_5.useAlpha)
                {
                    if (_loc_5.useDoubleAlpha)
                    {
                        _loc_3 = _loc_3 + "mov           ft0.y        \t\tfc1.z  \t\t  \t\t\t\t\t\t\t\t\t\t\t\t\n";
                        _loc_3 = _loc_3 + ("tex           ft1           \t\tft0.xy    \t\t\t\t" + getSmapleString("fs0", _loc_6.format, false, _loc_6.mipMode, "nearest") + "\t\n");
                        _loc_3 = _loc_3 + "mov           ft0.y        \t\tfc1.w  \t\t  \t\t\t\t\t\t\t\t\t\t\t\t\n";
                        _loc_3 = _loc_3 + ("tex           ft2           \t\tft0.xy    \t\t\t\t" + getSmapleString("fs0", _loc_6.format, false, _loc_6.mipMode, "nearest") + "\t\n");
                        _loc_3 = _loc_3 + "mov           ft3.x                {fcConst1}.w \t             \n";
                        _loc_3 = _loc_3 + "mul           ft3.x                {fcConst1}.w \t            ft3.x   \n";
                        _loc_3 = _loc_3 + "add           ft3.y                {fcConst1}.w \t            ft3.x                \n";
                        _loc_3 = _loc_3 + "slt           \t\tft3.z           \t{V_ParticleLife}.w    \t\t\tft3.x     \t\n";
                        _loc_3 = _loc_3 + "sge             ft3.w           \t{V_ParticleLife}.w    \t\t\tft3.y      \t\n";
                        _loc_3 = _loc_3 + "add           ft0.z           \tft3.z    \t\t\t\t\t\t\t\t\tft3.w      \t\n";
                        _loc_3 = _loc_3 + "sub           ft0.w           \t{fcConst1}.z    \t\t\t\t\t\tft0.z      \t\n";
                        _loc_3 = _loc_3 + "mul             ft1           \t\t   ft1    \t\t\t ft0.z      \t\n";
                        _loc_3 = _loc_3 + "mul             ft2           \t\t   ft2    \t\t\t ft0.w      \t\n";
                        _loc_3 = _loc_3 + "add             ft1           \t   ft1   \t\t\t ft2      \t\n";
                        _loc_3 = _loc_3 + "mul           {output}      \t\tft1.x  \t\t  \t\t\t{output}\t\t\t\t\t\t\t\n";
                    }
                    else
                    {
                        _loc_3 = _loc_3 + "mov           ft0.y        \t\tfc1.z  \t\t  \t\t\t\t\t\t\t\t\t\t\t\t\n";
                        _loc_3 = _loc_3 + ("tex           ft1           \t\tft0.xy    \t\t\t\t" + getSmapleString("fs0", _loc_6.format, false, _loc_6.mipMode, "nearest") + "\t\n");
                        _loc_3 = _loc_3 + "mul           {output}      \t\tft1.x  \t\t  \t\t\t{output}\t\t\t\t\t\t\t\n";
                    }
                }
            }
            _loc_3 = param1.toBuild(_loc_3, _loc_4);
            return _loc_3;
        }// end function

        override public function dispose() : void
        {
            this.particleFileData = null;
            super.dispose();
            return;
        }// end function

    }
}
